<template>
	<view class="Audit">
		<!-- 头部导航 -->
		<u-navbar :is-back="true" title="消息详情" :background="background" title-color="#fff" back-icon-color="#fff"
			:title-size="40"></u-navbar>
		<!-- 获取头部内容 -->
		<view class="detailHead">
			{{detail.title}}
		</view>
		<!-- 获取通知内容 -->
		<view class="detailBody">
			{{detail.desc}}
		</view>
		<!-- 获取时间 -->
		<view class="headTime">
			{{detail.created_at}}
		</view>
		<!-- <view v-if="detail.title == '您有一条新的申请'">
			<u-button size="medium" type="primary" :plain="true" shape="circle" @click="goapprovalList">查看申请</u-button>
		</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				//设置导航栏背景颜色
				background: {
					// 渐变色
					backgroundImage: 'linear-gradient(45deg, #A471FC, #77B4F7)'
				},
				detail: {},
				time: '',
			}
		},
		methods: {
			// pages/application/approvalList
			goapprovalList() {
				uni.navigateTo({
					url: `/pages/application/approvalList?id=${2}`
				})
			},
			//点击返回消息通知
			goOuts() {
				uni.navigateBack({
					url: './message'
				})
			},
		},
		onLoad(e) {
			//获取数据
			let detail = JSON.parse(e.item)
			this.detail = detail
			if (detail.desc == null) {
				this.detail.desc = '内容为空！'
			}
		}
	}
</script>

<style>
	.detailHead {
		width: 95%;
		margin: 10rpx auto 40rpx;
		font-size: 50rpx;
		font-weight: bold;
	}

	.headTime {
		width: 95%;
		margin: 0 auto;
		font-size: 24rpx;
		font-weight: none;
		color: #888888;
		position: relative;
		left: 470rpx;
	}

	.detailBody {
		text-align: justify;
		width: 95%;
		margin: 5rpx auto 15rpx;
		font-size: 30rpx;
		text-indent: 2em;
		line-height: 50rpx;
	}

	.goBack {
		width: 50%;
		letter-spacing: 10rpx;
		font-weight: bold;
		font-size: 16rpx;
	}

	u-button {
		margin: 100rpx 0;
		display: block;
		text-align: center;
	}
</style>
